<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商品列表</title>
    <script src="../js/jquery-2.1.1.min.js"></script>
    <script src="../js/base.js"></script>
    <script src="../js/vue.min.js"></script>
    <script src="commodity-list.js"></script>
    <link rel="stylesheet" href="../css/commodity.css">
</head>
<body>
<div id="commonity_list">
    <button class="button" onclick="go_send_order_list()">发货列表</button>
    <h3>商品列表</h3>
    <hr>
    <button class="button" onclick="go_create_commodity()">创建商品</button>
    <div>价格: <input type="text" id="price1">到<input type="text" id="price2"></div>
    <div>分类: <select id="com_classification">
        <option v-for="item in commodity_class_list">{{ item.classification }}</option>
    </select></div>
    <button class="button" @click="search_commodity">搜索</button>
    <table>
        <tr>
            <td>名称</td>
            <td>价格</td>
            <td>分类</td>
            <td>操作</td>
        </tr>
        <tr v-for="obj in commodity_list">
            <td>{{ obj.name }}</td>
            <td>{{ obj.price }}</td>
            <td>{{ obj.commodity_classification }}</td>
            <td>
                <button @click="go_commodity_detail(obj.id)">详情</button>
                <button @click="go_commodity_purchase()">采购</button>
                <button @click="go_add_img(obj.id)">添加图片</button>
            </td>
        </tr>
    </table>
    <br>
    <br>
    <table>
        <tr>
            <td>名称</td>
            <td>价格</td>
            <td>分类</td>
            <td>操作</td>
        </tr>
        <tr v-for="item in search_list">
            <td> {{ item.name }}</td>
            <td> {{ item.price }}</td>
            <td> {{ item.commodity_classification }}</td>
            <td>
                <button onclick="go_commodity_detail({{ item.id }})">详情</button>
                <button onclick="go_commodity_purchase()">采购</button>
            </td>
        </tr>
    </table>
</div>
</body>
</html>